const Koa=require('koa')
const Router=require('koa-router')
const router=new Router({prefix:'/api'})
const {APP_POST}=require('./config/config.default')
const app=new Koa()

router.get('/jsonp',(ctx,next)=>{
    const {cb,msg}=ctx.query
    ctx.body=`${cb}(${JSON.stringify({ msg })})`
})
app.use(router.routes())
app.listen(APP_POST,()=>{
    console.log(`server is running on  http://localhost:${APP_POST}`);
})